<!DOCTYPE html>
<html lang="en">

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
		<meta name="Generator" content="EditPlus®">
		<meta name="Author" content="梦想星辰大海">
		<meta name="Keywords" content="">
		<meta name="Description" content="">
		<title>cms后台模板</title>
		<link rel="stylesheet" href="${BASE_PATH}/static/book/res/lib/layui/css/layui.css">
	</head>

	<body>
		<form id="ff" method="post">
			<input id="txt-p" type="hidden" name="p" value="${filter.pageNum}"/>
			<div class="layui-form-item">
				<div class="layui-inline">
		     		<label class="layui-form-label">姓名</label>
	      			<div class="layui-input-block">
		        		<input type="text" name="name" value="${searchVo.name}" autocomplete="off" class="layui-input" onclick="layui.laydate({elem: this})">
	      			</div>
	    		</div>
				<div class="layui-inline">
		     		<label class="layui-form-label">用户名</label>
	      			<div class="layui-input-block">
		        		<input type="text" name="username" value="${searchVo.username}" autocomplete="off" class="layui-input" onclick="layui.laydate({elem: this})">
	      			</div>
	    		</div>
		    	<div class="layui-inline">
		     		<label class="layui-form-label">性别</label>
	      			<div class="layui-input-block">
		        		<input type="text" name="sex" value="${searchVo.sex}" autocomplete="off" class="layui-input" onclick="layui.laydate({elem: this})">
	      			</div>
	    		</div>
		    	<div class="layui-inline">
			      	<button class="layui-btn">确认</button>
			 	</div>
		 	</div>
		</form>
		<div class="layui-form">
		<table class="layui-table" lay-skin="line">
			  <colgroup>
			  	<col width="100">
			    <col width="200">
			    <col width="200">
			    <col width="200">
			    <col width="120">
			    <col width="200">
			    <col width="200">
			    <col>
			  </colgroup>
			  <thead>
			    <tr>
		    	  <th><input type="checkbox" name="" lay-skin="primary" lay-filter="allChoose"></th>
				  <th>用户头像</th>
			      <th>姓名</th>
			      <th>用户名</th>
			      <th>性别</th>
			      <th>联系电话</th>
			      <th>操作</th>
			    </tr> 
			  </thead>
			  <tbody>
			  [#list pageVo.list as user]
			    <tr>
			      <td><input type="checkbox" name="" lay-skin="primary"></td>
				  <td>${user.userPic}</td>
			      <td>${user.name}</td>
			      <td>${user.username}</td>
			      <td>${user.sexName}</td>
			      <td>${user.telephone}</td>
			      <td>
					<a href="userBorrow.htm?id=#{user.userId}" style="color: #707070;margin-right: 5px;">
						<i class="icon iconfont icon-bianji" style="color: #707070;"></i>添加图书
					</a>
				  </td>
		    	</tr>
		    	[/#list]
		  	  </tbody>
		    </table> 
	  	</div>
	    <div id="demo1"></div>
	</body>
	<script type="text/javascript" src="${BASE_PATH}/static/book/res/lib/layui/layui.js"></script>
	<script>
	layui.use(['laypage', 'layer','form'], function(){
	  var $ = layui.jquery, form = layui.form();
	  var laypage = layui.laypage,layer = layui.layer;
	  
	  //全选
	  form.on('checkbox(allChoose)', function(data){
	    var child = $(data.elem).parents('table').find('tbody input[type="checkbox"]');
	    child.each(function(index, item){
	      item.checked = data.elem.checked;
	    });
	    form.render('checkbox');
	  });
	  
	  
	  //分页
		laypage({
			cont: 'demo1'
			,pages: ${pageVo.pageCount} //总页数
			,curr: ${pageVo.pageNum}
			,groups: 5 //连续显示分页数
			,jump: function(obj, first) {
				if(first===true){
					return ;
				}
				var curr = obj.curr;
				console.dir(curr);
				$("#txt-p").val(curr);
				//得到了当前页，用于向服务端请求对应数据
				$("#ff").submit();
				
			}
		});
	  
	});
	</script>

</html>